This section describes the low-level functions that are called by higher-level Window Manager functions. Ordinarily, you won't need to use these functions.
Scans the window list for windows that need updating.
pascal Boolean CheckUpdate (EventRecord *theEvent);
The CheckUpdate function scans the window list from front to back, checking for a visible window that needs updating (that is, a visible window whose update region is not empty). If it finds one whose window record contains a picture handle, it redraws the window itself and continues through the list. If it finds a window record whose update region is not empty and whose window record does not contain a picture handle, it stores an update event in the event record referenced through the parameter theEvent and returns true . If it finds no such window, it returns false .
The Event Manager is the only software that ordinarily calls CheckUpdate .
Determines the clip region of the Window Manager port.
pascal void ClipAbove (WindowPtr window);
The ClipAbove function sets the clip region of the Window Manager port to be the area of the desktop that intersects the current clip region, minus the structure regions of all the windows in front of the specified window.
The ClipAbove function retrieves the desktop region from the global variable GrayRgn.
The Window Manager is the only software that ordinarily calls ClipAbove .
Saves a window's current structure and content regions.
pascal void SaveOld (WindowPtr window);
The SaveOld function saves the specified window's current structure region and content region for the DrawNew function (DrawNew) . Each call to SaveOld must be balanced by a subsequent call to DrawNew.
Erases and updates changed window regions.
pascal void DrawNew (WindowPtr window,
Boolean update);
The DrawNew function erases the parts of a window's structure and content regions that are part of the window's former state and part of its new state but not both.
If the update parameter is set to true , DrawNew also updates the erased regions.
Each call to SaveOld must be balanced by a subsequent call to DrawNew . In C, SaveOld and DrawNew can't be nested. That is, you must call DrawNew before the next call to SaveOld .
The Window Manager is the only software that ordinarily calls DrawNew .
Redraws the invalid, exposed portions of one window on the desktop.
pascal void PaintOne (WindowPtr window, RgnHandle clobberedRgn);
The PaintOne function "paints" the invalid portion of the specified window and all windows above it. It draws as much of the window frame as is in clobberedRgn and, if some content region is exposed, erases the exposed area (paints it with the background pattern) and adds it to the window's update region. If the value of the window parameter is nil , the window is the desktop, and PaintOne paints it with the desktop pattern.
The Window Manager is the only software that ordinarily calls PaintOne .
The global variables SaveUpdate and PaintWhite are flags used by PaintOne . Normally both flags are set. Clearing SaveUpdate prevents clobberedRgn from being added to the window's update region. Clearing PaintWhite prevents clobberedRgn from being erased before being added to the update region (this is useful, for example, if the background pattern of the window isn't the background pattern of the desktop). The Window Manager sets both flags periodically, so you should clear the appropriate flags each time you need them to be clear.
Redraws a series of windows in the window list.
pascal void PaintBehind (WindowPtr startWindow,
RgnHandle clobberedRgn);
The PaintBehind function calls PaintOne (PaintOne) for startWindow and all the windows behind startWindow , clipped to clobberedRgn .
The Window Manager is the only software that ordinarily calls PaintBehind .
Calculates the visible regions of a series of windows.
pascal void CalcVisBehind (WindowPtr startWindow,
RgnHandle clobberedRgn);